package com.luhan.fmmall.controller;

import com.luhan.fmmall.service.UserAddrService;
import com.luhan.fmmall.vo.ResultVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@CrossOrigin
@Api(value = "提供收货地址相关接口",tags = "收货地址管理")
@RequestMapping("/useraddr")
public class UserAddrController {

    @Autowired
    private UserAddrService userAddrService;

    @ApiOperation("查询用户地址列表接口")
    @ApiImplicitParam(dataType = "int",name = "userId",value = "用户id",required = true)
    @GetMapping("/list")
    public ResultVO listUserAddr(Integer userId,
                                 @RequestHeader("token") String token){
        ResultVO resultVO = userAddrService.selectUserAddrByUid(userId);
        return resultVO;
    }
}
